package 分支和循环.分支练习;

import java.util.Scanner;

public class HomeWork2 {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("头");
        int x=sc.nextInt();
        System.out.println("脚");
        int y=sc.nextInt();

        for (int i = 0; i <= x; i++) {//头  i==鸡头     x-i==>兔子
            if(i*2+(x-i)*4==y){//鸡脚+兔子脚===总脚数
                System.out.println("鸡"+i+"，兔子："+(x-i));
                break;
            }
        }

    }
}
